<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link href="/dtpr/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="/dtpr/Flat-UI/css/flat-ui.min.css" rel="stylesheet" type="text/css">
    <link href="/dtpr/css/home.css" rel="stylesheet" type="text/css">
    <link href="/dtpr/css/exam.css" rel="stylesheet" type="text/css">
    <link href="/dtpr/css/message.css" rel="stylesheet" type="text/css">
    <script src="/dtpr/bootstrap/js/jquery-3.2.1.min.js"></script>
    <script src="/dtpr/js/home.js"></script>
    <script src="/dtpr/html/background/exam/js/message.js"></script>
    <title>消息管理</title>
</head>
<body>
<!--网页头-->
<script src="/dtpr/js/bgHead.js"></script>
<!--网页体-->
<div class="main">
    <!--网页主体-->
    <div class="p-body">
        <div class="p-send">
            <p>选择要发送消息的对象</p>
            <div class="select">
                <button class="btn btn-lg btn-primary" data-toggle="modal" data-target="#teacher-send">老师</button>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <button class="btn btn-lg btn-danger" data-toggle="modal" data-target="#student-send">学生</button>
            </div>
        </div>
        <hr>
        <div class="p-message">
            <p>历史消息</p>
            <div class="choice">
                <button id="teacher" onclick="selectType(0)">老师</button>
                <button id="student" onclick="selectType(1)">学生</button>
            </div>
        </div>
        <div class="message-list">
            <!--表格-->
            <div class="p-table">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>消息标题</th>
                        <th>内容</th>
                        <th>发布时间</th>
                    </tr>
                    </thead>
                    <!--表格内容块-->
                    <tbody>
                    <script>table()</script>
                    </tbody>
                </table>
            </div>
            <!--分页-->
            <div class='p-page text-center'>
                <script>messagePage()</script>
            </div>
        </div>
    </div>
    <!--modal 老师-->
    <div class="modal fade" id="teacher-send" tabindex="-1" role="dialog" aria-labelledby="sendClassLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="sendClassLabel">发送老师消息</h4>
                </div>
                <form class="form-horizontal" role="form" method="post" action="index.php?exam-master-basic-addPublicmessage">
                    <div class="modal-body">
                        <input name="args[user]" type="hidden" value="0">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">标题</label>
                            <div class="col-sm-6">
                                <input maxlength="50" type="text" class="form-control" name="args[title]">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">收件人</label>
                            <div class="col-sm-6">
                                <p>所有老师</p>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">内容</label>
                            <div class="col-sm-6">
                                <textarea class="form-control" cols="60" id="classContent" rows="10" name="args[content]"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="submit" class="btn btn-info">发送</button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <!--modal 学生-->
    <div class="modal fade" id="student-send" tabindex="-1" role="dialog" aria-labelledby="sendClassLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="sendPersonLabel">发送学生消息</h4>
                </div>
                <form class="form-horizontal" role="form" method="post" action="index.php?exam-master-basic-addPublicmessage">
                    <div class="modal-body">
                        <input name="args[user]" type="hidden" value="1">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">标题</label>
                            <div class="col-sm-6">
                                <input maxlength="50" type="text" class="form-control" name="args[title]">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">收件人</label>
                            <div class="col-sm-6">
                                <p>所有学生</p>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">内容</label>
                            <div class="col-sm-6">
                                <textarea class="form-control" cols="60" rows="10" id="personContent" name="args[content]"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="submit" class="btn btn-info">发送</button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<!--网页脚-->
<script src="/dtpr/js/foot.js"></script>
<script src="/dtpr/Flat-UI/js/flat-ui.min.js"></script>
<script>
    initButton();
</script>
</body>
</html>